import request from '@/config/axios'

// ERP SPU级产品 VO
export interface ErpProductSpuVO {
  id: number // 产品编号
  spu: number // SPU
  name: string // 商品名称
  categoryId: number // 货号
  status: number // 状态
  purchasePrice: number // 成本
  salePrice: number // 报价
}

// ERP SPU级产品 API
export const ErpProductSpuApi = {
  // 查询ERP SPU级产品分页
  getErpProductSpuPage: async (params: any) => {
    return await request.get({ url: `/myerp/erp-product-spu/page`, params })
  },

  // 查询ERP SPU级产品详情
  getErpProductSpu: async (id: number) => {
    return await request.get({ url: `/myerp/erp-product-spu/get?id=` + id })
  },

  // 新增ERP SPU级产品
  createErpProductSpu: async (data: ErpProductSpuVO) => {
    return await request.post({ url: `/myerp/erp-product-spu/create`, data })
  },

  // 修改ERP SPU级产品
  updateErpProductSpu: async (data: ErpProductSpuVO) => {
    return await request.put({ url: `/myerp/erp-product-spu/update`, data })
  },

  // 删除ERP SPU级产品
  deleteErpProductSpu: async (id: number) => {
    return await request.delete({ url: `/myerp/erp-product-spu/delete?id=` + id })
  },

  // 导出ERP SPU级产品 Excel
  exportErpProductSpu: async (params) => {
    return await request.download({ url: `/myerp/erp-product-spu/export-excel`, params })
  }
}